package com.guchenbo.example.lock;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

@ChannelHandler.Sharable
public class WaitClientCloseServerHandler extends SimpleChannelInboundHandler<String> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
        if ("bye".equals(msg)) {
            System.out.println("receive bye");
            ctx.channel().close();
            ctx.channel().parent().close();
        }

    }
};
